Skip to main content

Features

This hook provides a unified interface for managing connected wallets, both embedded (WaaS) and external wallets. The user is prompted to sign a transaction with their active wallet in order to link wallets enabling read-only functionality. Key features:
  • Get information about all connected wallets
  • Set a specific wallet as active
  • Disconnect wallets
  • View linked wallets for embedded wallets
  • Refresh the list of linked wallets
For embedded wallets (Wallet-as-a-Service), the hook automatically fetches linked wallets if available. Linked wallets are additional wallets that have been connected to the primary embedded wallet.

Import

Usage

Return Type: UseWalletsReturnType

The hook returns an object with the following properties:

Properties

wallets

ConnectedWallet[] Array of all connected wallets.

linkedWallets

LinkedWallet[] | undefined Array of linked wallets for the active embedded wallet (if any). Only available when using a WaaS wallet.

setActiveWallet

(address: string) => Promise<void> Function to set a wallet as active by its address.

disconnectWallet

(address: string) => Promise<void> Function to disconnect a wallet by its address.

refetchLinkedWallets

() => Promise<void> Function to refresh the list of linked wallets. Useful after linking a new wallet.